<?php 
$Content = QContext::instance();
$base_url = $Content->requestUDI();
$search = $base_url;
$search['action'] = 'search';
$lock = $base_url;
$lock['action'] = 'lock';
$add = $base_url;
$add['action'] = 'add';
$tree = $base_url;
$tree['action'] = 'tree';
?>
<form id="pagerForm" method="get" action="<?php echo url($base_url,null,null,array('mode'=>'standard'));?>">
		<input type="hidden" name="pageNum" value="<?php echo $pagination['current'];?>" /> <!--【必须】value=1可以写死-->
		<input type="hidden" name="numPerPage" value="<?php echo $pagination['page_size'];?>" /> <!--【可选】每页显示多少条-->
		
</form>

<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?php echo url($base_url,null,null,array('mode'=>'standard'));?>" method="get">
	<div class="searchBar">
		<table class="searchContent">
		<tbody>
			<tr>
				<td><label>用户ID：</label></td>
				<td><input type="text" name="userid" value="<?php echo isset($param['userid'])?$param['userid']:'';?>"/>
				<input type="hidden" name="_querymethod[userid]" value="like"></td>
			
			
				<td><label>用户等级：</label></td>
			<td><input type="text" name="userlevel" value="<?php echo isset($param['userlevel'])?$param['userlevel']:'';?>" />
			</td>
				<td><label>注册时间：</label></td>
			<td><input type="text" class="date" name="createtime_timestart" value="<?php echo isset($param['createtime_timestart'])?$param['createtime_timestart']:'';?>" />---<input type="text" class="date" name="createtime_timeend" value="<?php echo isset($param['createtime_timeend'])?$param['createtime_timeend']:'';?>" />
			</td>
		</tr></tbody></table>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			
			<li><a title="确实要锁定这些用户吗?" target="selectedTodo" rel="ids" href="<?php echo url($lock)?>" class="delete"><span>批量锁定</span></a></li>
			<li class="line">line</li>
<!-- 			<li><a class="edit" href="<?php echo url($add)?>/id/{id}" target="dialog" height="500" warn="请选择一个产品"><span>修改</span></a></li>
			<li class="line">line</li> -->
		</ul>
	</div>
	<table class="table" width="1200" layoutH="138">
		<thead>
			<tr>
				<th width="5%"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="15%" orderField="p_code" >用户账号(手机号码)</th>
				<th width="15%" orderField="title">用户等级</th>
				<th width="10%" orderField="price">推荐人</th>
				<th width="10%" orderField="send_price">积分点</th>
				<th width="10%" align="center" orderField="weight">账号状态</th>
				<th width="15%" align="center" orderField="weight">注册时间</th>
				
				<th width="25%">操作</th>
			</tr>
		</thead>
		<tbody>
			<?php foreach ($item as $k=>$v):?>
			<tr target="id" rel="<?php echo $v->id?>">
				<td><input name="ids" value="<?php echo $v->id?>" type="checkbox"></td>
				<td><?php echo $v->userid?>(<?php echo $v->userphone;?>)</td>
				<td><?php echo $v->userlevel?></td>
				<td><?php echo $v->parent->userid;?></td>
				<td><?php echo $v->userpoint?>点</td>
				<td><?php echo $v->status?'锁定':'正常';?></td>
				<td><?php echo date('Y-m-d G:i:s',$v->createtime);?></td>
				
				<td>
				
					<?php if (count($v->subuser)==0):?>
					 无下级用户
					 <?php else:?>
					<a href="<?php echo url($tree,array('userid'=>$v->userid),null,array('mode'=>'standard'));?>" target="dialog" rel="page2" width="600" height="400">查看树形列表</a>
					<a href="<?php echo url($base_url,array('parentuserid'=>$v->userid),null,array('mode'=>'standard'))?>" target="navTab" >查看下级用户</a></td>
					<?php endif;?>
			</tr>
			<?php endforeach;?>
		</tbody>
	</table>
	<div class="panelBar">
			<div class="pages">
			<span>显示</span>
			<select name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20" <?php if(isset($param['numPerPage'])&&$param['numPerPage']==20)echo 'selected=selected';?>>20</option>
				<option value="50" <?php if(isset($param['numPerPage'])&&$param['numPerPage']==50)echo 'selected=selected';?>>50</option>
				<option value="100" <?php if(isset($param['numPerPage'])&&$param['numPerPage']==100)echo 'selected=selected';?>>100</option>
				<option value="200" <?php if(isset($param['numPerPage'])&&$param['numPerPage']==200)echo 'selected=selected';?>>200</option>
			</select>
				<span>共 <?php echo $pagination['record_count'];?> 条</span>
			</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $pagination['record_count'];?>" numPerPage="<?php echo $pagination['page_size'];?>" pageNumShown="10" currentPage="<?php echo $pagination['current'];?>" ></div>

	</div>
</div>